class editor_logic :
    def __init__ ( self , mediator ) :
        self . _awake = False
        self . _base_name = None
        self . _mediator = mediator
        self . _key_escape_counter = None
    def key_escape_counter_reply ( self , counter ) :
        self . _key_escape_counter = counter
    def show_editor ( self ) :
        self . _awake = True
        self . _mediator . key_escape_counter_request ( )
        self . _stored_key_escape_counter = self . _key_escape_counter
        self . _mediator . add_title_label_to_editor ( self . _base_name )
    def hide_editor ( self ) :
        self . _awake = False
    def select_knowledge_base_for_editing ( self , base_name ) :
        self . _base_name = base_name
    def save_knowledge_base_in_editor ( self ) :
        pass
    def save_as_knowledge_base_in_editor ( self , base_name ) :
        pass
    def on_key_escape ( self ) :
        if self . _awake :
            self . _mediator . key_escape_counter_request ( )
            if self . _key_escape_counter != self . _stored_key_escape_counter :
                self . _mediator . on_editor_menu_button ( )
